//
//  TTIImagePickerManager.h
//  iOSCodeProject
//
//  Created by Fox on 14-7-18.
//  Copyright (c) 2014年 翔傲信息科技（上海）有限公司. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#if NS_BLOCKS_AVAILABLE
typedef void(^TTIImagePickerManagerCompletedBlock)(UIImage *resultImage, UIImage *orignImage);
typedef void(^TTIImagePickerManagerFailedBlock)(NSError *error);
#endif

typedef NS_ENUM(NSInteger, TTIImagePickerManagerType){
    
    TTIImagePickerManagerBoth = 1,                  //通过相机或相册获取照片
    TTIImagePickerManagerCamera = 2,                //通过相机拍照获取照片
    TTIImagePickerManagerPhotoLibrary = 3           //通过响彻获取照片
    
};

/**
 *  系统图片选择器：选择图片和拍照
 */
@interface TTIImagePickerManager : NSObject <UIActionSheetDelegate,UINavigationControllerDelegate
,UIImagePickerControllerDelegate>

/**
 *  创建单例对象
 *
 *  @return 单例对象
 */
+ (TTIImagePickerManager *)shareInstance;

/**
 *  选择照片
 *
 *  @param pickerType    选取照片对象的类型
 *  @param enableEditing 是否允许编辑
 *  @param delegate      当前拍照控制器委托(此参数需要为拍摄界面的控制器对象)
 *  @param completeBlock 完成的block
 *  @param failedBlock   失败的block
 */
- (void)imagePickerWithType:(TTIImagePickerManagerType )pickerType
              enableEditing:(BOOL)enableEditing
               withDelegate:(id )delegate
               comleteBlock:(TTIImagePickerManagerCompletedBlock )completeBlock
                failedBlock:(TTIImagePickerManagerFailedBlock)failedBlock;

@end
